home *** CD-ROM | disk | FTP | other *** search
/ Aminet 23 / Aminet 23 (1998)(GTI - Schatztruhe)[!][Feb 1998].iso / Aminet / biz / dopus / DOpusPatch6265.lha / pch565 / Opus_Patch562-565 < prev    next >
Text File  |  1997-08-28  |  4KB  |  206 lines

  1. ; Opus_Patch562-565
  2. ; Installer script to update Directory Opus Magellan version 5.62 to 5.65
  3. ;
  4. ; Directory Opus Update Version $VER: Opus_Patch562-565  (26.08.97)
  5.  
  6. ; COPYRIGHT ©1997 GP SOFTWARE, AUSTRALIA
  7.  
  8.  
  9. (complete 0)
  10.  
  11. (procedure clear_assigns
  12.  
  13.     (makeassign "DOPNEW")
  14.     (makeassign "PCH")
  15.     (makeassign "DOPOLD")
  16. )
  17.  
  18. (procedure signal_opus
  19.  
  20.     (set #Sigs (tackon #SRC "dopusmsg"))
  21.     (if (exists #Sigs (noreq))
  22.         (run (cat #Sigs " DOPUS.1 \"command set notify off\""))
  23.     )
  24. )
  25.  
  26. (procedure make_newfiles ; (#EXT) requires #EXT to be set before call
  27.  
  28.         (working "Updating modules/configopus.module")
  29.         (run (cat (tackon #SRC "spatch") " -oDOPNEW:modules/configopus.module -pPCH:configopus."#EXT" DOPOLD:modules/configopus.module"))
  30.         (working "Updating modules/icon.module")
  31.         (run (cat (tackon #SRC "spatch") " -oDOPNEW:modules/icon.module -pPCH:icon."#EXT" DOPOLD:modules/icon.module"))
  32.         (working "Updating modules/filetype.module")
  33.         (run (cat (tackon #SRC "spatch") " -oDOPNEW:modules/filetype.module -pPCH:filetype."#EXT" DOPOLD:modules/filetype.module"))
  34.         (working "Updating libs/dopus5.library")
  35.         (run (cat (tackon #SRC "spatch") " -oDOPNEW:libs/dopus5.library -pPCH:dopuslib."#EXT" DOPOLD:libs/dopus5.library"))
  36.         (working "Updating DirectoryOpus")
  37.         (run (cat (tackon #SRC "spatch") " -oDOPNEW:DirectoryOpus -pPCH:dopus."#EXT" DOPOLD:DirectoryOpus"))
  38.  
  39. )
  40.  
  41.  
  42. (procedure wrong_version
  43.  
  44.     (message #Title_msg
  45.         "Sorry, you have the wrong version of DirectoryOpus.\n\n"
  46.         "This upgrade will NOT WORK for your version.\n"
  47.  
  48.         #README
  49.  
  50.         "Your Opus version is "#dop_ver"."#dop_rev".\n"
  51.         "and the library is "#lib_ver"."#lib_rev"\n")
  52.  
  53.     (exit "Installation terminated!")
  54.  
  55. )
  56.  
  57. (procedure anyone_home
  58.  
  59.     (message #Title_msg
  60.         "Sorry, cannot find DirectoryOpus on you system!\n\n"
  61.         #README)
  62.         
  63.     (exit "Installation terminated!")
  64.  
  65. )
  66.  
  67. (procedure wrong_dopus
  68.  
  69.         
  70.     (message #Title_msg
  71.         "Sorry, you have the wrong version of DirectoryOpus.\n\n"
  72.         "This upgrade will NOT WORK for your version.\n\n"
  73.  
  74.         #README
  75.  
  76.         "Your Opus version is "#dop_ver"."#dop_rev".\n")
  77.  
  78.     (exit "Instalation terminated!")
  79. )
  80.  
  81.  
  82. (procedure get_ext
  83. ; work out which library version, should be enough
  84.  
  85.     (set #lib_ver 0)
  86.  
  87.     (if (exists #DOPUSLIB (noreq))
  88.         (
  89.         (set #Vernum (getversion #DOPUSLIB))
  90.         (set #lib_ver (/ #Vernum 65536))
  91.         (set #lib_rev (- #Vernum (* #lib_ver 65536) ) )
  92.     
  93.         (if    (AND (= #lib_ver 62 ) (= #lib_rev 0 ))
  94.             (
  95.             (set #EXT "pch65")
  96.             (set #PATCHNAME "Opus6265Patch.lha")
  97.             )
  98.         )
  99.         )
  100.         (anyone_home)
  101.  
  102.     )
  103.  
  104.     (if    (= #lib_ver 0)
  105.         (wrong_version)
  106.     )
  107. )
  108.  
  109. ;
  110. ; start
  111. ;
  112.  
  113. (
  114. (onerror clear_assigns)
  115.  
  116.  
  117. (set #OLD_OPUS "DOpus5:")
  118. (set #FINAL "DOpus5:")
  119. (set @default-dest #FINAL)
  120.  
  121. (set #NEW_OPUS "ram:OP565")
  122. (set #PCH_TMP "ram:OPPCHTMP")
  123. (set #SRC "ram:PCH565")
  124. (set #WANTVER 62)
  125.  
  126. (set #DOPUSPROG (tackon #OLD_OPUS "DirectoryOpus"))
  127. (set #DOPUSLIB (tackon #OLD_OPUS "libs/dopus5.library"))
  128.  
  129. (set #README "Please read the ReadMe acompanying this archive or contact GPSoftware for details of upgrades\n\n")
  130.  
  131. (clear_assigns)
  132. (signal_opus)
  133.  
  134.  
  135. (makeassign "DOPOLD" #OLD_OPUS)
  136. (makedir #NEW_OPUS)
  137.  
  138. (makeassign "DOPNEW"  #NEW_OPUS)
  139. (makedir "DOPNEW:modules")
  140.  
  141. (makedir "DOPNEW:c")
  142. (makedir "DOPNEW:help")
  143. (makedir "DOPNEW:libs")
  144.  
  145. (makedir #PCH_TMP)
  146. (makeassign "PCH" #PCH_TMP)
  147.  
  148.  
  149. ; main procedure
  150.  
  151.  
  152.     (set #Title_msg "Directory Opus Magellan Update Patch.\n\n")
  153.  
  154.     (message #Title_msg
  155.         "This procedure will update your existing version of"
  156.         " Directory Opus Magellan 5.62 to version  5.65.\n\n"
  157.         "When finished, you will need to reboot your Amiga."
  158.         )
  159.  
  160.     (if (exists #DOPUSPROG (noreq))
  161.         (
  162.         (set #Vernum (getversion #DOPUSPROG))
  163.         (set #Dop_ver (/ #Vernum 65536))
  164.         (set #Dop_rev (- #Vernum (* #Dop_ver 65536) ) )
  165.         );else
  166.         (anyone_home)
  167.     )
  168.  
  169.  
  170.     (if    (AND (= #dop_ver 5 ) (= #dop_rev #WANTVER ))
  171.         (get_ext)
  172.         (wrong_dopus) ;else
  173.  
  174.     )
  175.  
  176.     (if (exists (tackon #SRC #PATCHNAME))
  177.         (
  178.         (working "Unarchiving patch files...")
  179.         (run (cat (tackon #SRC "lhex") " >NIL: <NIL: -qfw=PCH: x " (tackon #SRC #PATCHNAME)))
  180.  
  181.         (make_newfiles)
  182.     
  183.         (copyfiles (source "DOPNEW:") (dest #FINAL) (all) (optional force))
  184.         (copyfiles (source (tackon #SRC "ReadMe_Magellan565")) (dest #FINAL) (infos))
  185.  
  186.     
  187.         ;
  188.         ; tidyup
  189.         ;
  190.  
  191.         (clear_assigns)
  192.         (run (cat "C:Delete " #PCH_TMP " all"))
  193.         (run (cat "C:Delete " #NEW_OPUS " all"))
  194.     
  195.         ); else
  196.         (message #Title_msg
  197.             "Woops! Cannot find the patch archive\n"
  198.              "Required archive: "#PATCHNAME".\n\n"
  199.         )
  200.         
  201.     )
  202.  
  203. (clear_assigns)
  204. )
  205.